﻿<style type="text/css">
    body { overflow: hidden; }
</style>
<form method="post">
    @Html.AntiForgeryToken()
    <br />
    <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
        <tr>
            <th style="width: 100px;">
                旧密码：
            </th>
            <td>
                <input type="password" name="oldpass" id="oldpass" class="mytext" value="" validate="empty" style="width: 55%" />
            </td>
        </tr>
        <tr>
            <th>
                新密码：
            </th>
            <td>
                <input type="password" name="newpass" id="newpass" class="mytext" value="" validate="empty" style="width: 55%" />
            </td>
        </tr>
        <tr>
            <th>
                确认新密码：
            </th>
            <td>
                <input type="password" name="newpass1" id="newpass1" class="mytext" value="" validate="equal" validate_equalfor="newpass" errmsg="与新密码输入不一致" style="width: 55%" />
            </td>
        </tr>
    </table>
    <div class="buttondiv">
        <input type="button" value="确定保存" class="mybutton" onclick="savePass(this);" />
        <input type="button" class="mybutton" value="取消关闭" style="margin-left: 5px;" onclick="new RoadUI.Window().close();" />
    </div>
</form>
<script>
    $(function ()
    {
        
    });
    function savePass(but) {
        var f = document.forms[0];
        if (new RoadUI.Validate().validateForm(f)) {
            var o = RoadUI.Core.serializeForm($(f));
            $(but).prop("disabled", true);
            $.ajax({
                url: "SaveEditPass@(Html.Raw(ViewData["queryString"]))", data: o, type: "post", success: function (text) {
                    if (RoadUI.Core.checkLogin(text, false)) {
                        alert(text);
                    }
                    $(but).prop("disabled", false);
                    new RoadUI.Window().close();
                }
            });
        }
    }
</script>